home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / recent / dalhel.lha / DalHelper / Rexx / DalHelper.amirx
Text File  |  1998-06-22  |  13KB  |  16 lines

  1. /* DalHelper.amirx
  2. \\ $VER: DalHelper.amirx 5.13 (08.04.98)
  3. // Written by Donald T. Becker (dtbecker@prolog.net) IRC: StarDustr
  4. \\ Please mail any bug reports/comments to the above address with a subject
  5. // header of DalHelper.amirx.
  6. \\
  7. // ** What to do with this file?
  8. \\ Put this script in AmIRC/Rexx
  9. //  Make the following Aliases:
  10. \\
  11. //  /Alias  CS  /Rx DalHelper C %p
  12. \\  /Alias  MS  /Rx DalHelper M %p
  13. //  /Alias  NS  /Rx DalHelper N %p
  14. \\
  15. */
  16. ;parse arg j1 j2 j3 j4 j5 j6;j1=upper(j1);x1=left(upper(j2),3);x2=left(upper(j2),2);if j1 ~='M'&j1 ~='N'&j1 ~='C'&j1 ~='QUIT'&j1 ~='IDA' then exit;if j1='QUIT' then;do;call setclip("DALHG_Title");call setclip("DALHG_Version");call setclip("DALHG_Copyright");call setclip("DALHG_Author");call setclip("DALHG_Description");exit;end;if j1='C' then DalDest="CHANSERV";if j1='M' then DalDest="MEMOSERV";if j1='N' then DalDest="NICKSERV";DalVer="$VER: DalHelper 5.13 (08.04.98)";if ~show('c',"DALHG_Title") then;do;setclip("DALHG_Title","DalHelper");setclip("DALHG_Version", DalVer);setclip("DALHG_Copyright","December 1996  by StarDustr");setclip("DALHG_Author","StarDustr  @Dal.net on #AmIRC");setclip("DALHG_Description","An Easy to Use Interface to Dalnet Services");end;CCmd1="AKAdd, AKDel, AKList, AOAdd, AODel, AOList, COunt, DOP, DRop, HElp, IDentify, INfo, MDeop,";CCmd2="MKick, OP, PAsswd, REGister, SIDent, SKTopic, SLOps, SMEmo, SOAdd, SODel,";CCmd3="SDEsc, SMLock, SOGuard, SOList, SPRivate, SREstrict, STLlock, SURl, SUSecure, UNban.";CCmds=CCmd1 CCmd2 CCmd3;MCmds="DAll, DElete, HElp, LIst, PUrge, REad, SEnd, UNdel.";NCmd1="AAdd, ADel, AList, DRop, GHost, HElp, IDentify, INfo, PAsswd,";NCmd2="RECover, REGister, RELease, SKIll, SNMemo, SURl.";NCmds=NCmd1 NCmd2;if j1='M'|x2="IN"|x2="HE" then signal NoNeed;ReadFile=1;fname="";if ~show('L',"rexxsupport.library") then;if ~addlib("rexxsupport.library",0,-30,0) then exit;xx=' '||showlist('a',,' ')||' '||showlist('v',,' ')||' ';if 0 ~=pos(' MCF ',xx) then;if exists("MCF:MCF.Dal") then;fname="MCF:MCF.Dal";if exists("MCF.Dal") then;fname="MCF.Dal";if 0 ~=pos(' DALHELPER ',xx) then;if exists("DalHelper:MCF.Dal") then;fname="DalHelper:MCF.Dal";if fname="" then fname="MCF.Dal";if ~open("Input",fname,'r') then;do;fname="MCF.Dal";address command "Echo >"fname DalVer;ReadFile=0;end;ccnt=0;ncnt=0;if ReadFile then;do;do mcnt=1 by 1 until eof("Input");xx=readln("Input");Dal.mcnt=xx;Byte1=left(xx,1);select;when Byte1='$' then continue;when Byte1='#' then;do;ccnt=ccnt+1;parse value xx with Chan.ccnt CPass.ccnt TRest.mcnt;end;when Byte1 ~=' ' then;do;ncnt=ncnt+1;parse value xx with Nick.ncnt NPass.ncnt TRest.mcnt;end;otherwise continue;end;end mcnt;call close("Input");end;options results;getchannel;CurChan=result;getmynick;MyNick=result;if j1='IDA' then signal IdAll;j6=strip(j6,'B');if j1='N' then;do;who=upper(MyNick);if j3 ~="" then Name=upper(j3);if j3="" then;do;if 0 ~=pos(x2,'ID DR AL GH') then Name=upper(MyNick);if 0=pos(x2,'ID DR AL GH') then Name=upper(Nick.1);if 0 ~=pos(x1,'REC REL') then Name=upper(MyNick);if x1 ~='SUR' then j3=Name;end;if 0=pos('@',Name) then;do;do cntn=1 by 1 until cntn=ncnt;if upper(Nick.cntn)=Name then;do;CPas=Nick.cntn NPass.cntn;cntn=ncnt;end;end;end;end;if j1='C' then;do;if j3 ~="" then Chan=upper(j3);if j3="" then;do;if 0 ~=pos(x2,'ID DR') then Chan=upper(CurChan);if 0=pos(x2,'ID DR') then Chan=upper(Chan.1);if 0 ~=pos(x1,'AOL SOL SUR') then Chan=upper(CurChan);j3=Chan;end;pl=pos('@',Chan)+pos('*',Chan);if pl=0 then;do;do cntc=1 by 1 until cntc>ccnt;if upper(Chan.cntc)=Chan then;do;CPas=Chan CPass.cntc;cntc=ccnt+1;end;end;end;end;if x1='REG'|x2='PA' then;do;RParm=j3;if j4 ~="" then RParm=RParm j4;if j5 ~="" then RParm=RParm j5;if j6 ~="" then RParm=RParm j6;if j1='C'&0=pos('#',RParm) then;do;call GetChan();RParm=Chan RParm;if j4="" then;do;if x1='REG' then RParm=RParm "My Channel";end;parse value RParm with j3 j4 junk;end;end;NoNeed:;select;when j6 ~="" then xhelp=j3 j4 j5 j6;when j5 ~="" then xhelp=j3 j4 j5;when j4 ~="" then xhelp=j3 j4;when j3 ~="" then xhelp=j3;otherwise xhelp="";end;select;when x2='DR' then "RAW "DalDest" :Drop" j3;when x2='HE' then "RAW "DalDest" :Help" xhelp;when x2='ID' then "RAW "DalDest" :Identify" CPas;when x2='IN' then "RAW "DalDest" :Info" j3;when x2='PA' then "RAW "DalDest" :Passwd" RParm;when x1='REG' then "RAW "DalDest" :Register" RParm;when j1='N' then select;when x2='AA' then "RAW "DalDest" :Access Add" j3;when x2='AD' then "RAW "DalDest" :Access Del" j3;when x2='AL' then "RAW "DalDest" :Access List" j3;when x2='GH' then "RAW "DalDest" :Ghost" CPas;when x1='REC' then;do;"RAW "DalDest" :Recover" CPas;"RAW "DalDest" :Release" CPas;end;when x1='REL' then "RAW "DalDest" :Release" CPas;when x1='SKI' then;do;if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET KILL" Name;end;when x1='SNM' then;do;if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET NOMEMO" Name;end;when x1='SUR' then "RAW "DalDest" :SET URL" j3;otherwise;do;"echo P="d2c(27)"««MCF»" " "d2c(2)"NickServ"d2c(2)" commands are:" NCmd1;"echo P="d2c(27)"««MCF»" ":"NCmd2;end;end;when j1='C' then select;when x2='CO' then "RAW "DalDest" :COunt" Chan;when x2='MD' then "RAW "DalDest" :MDeop" Chan;when x2='MK' then "RAW "DalDest" :MKick" Chan;when x2='UN' then "RAW "DalDest" :UnBan" Chan "Me";when x2='OP' then;do;call GetChan();"RAW "DalDest" :OP" Chan Name;end;when x1='AKA' then;do;call GetChan();"RAW "DalDest" :AKick" Chan "Add" Name;end;when x1='AKD' then;do;call GetChan();"RAW "DalDest" :AKick" Chan "Del" Name;end;when x1='AKL' then;do;call GetChan();"RAW "DalDest" :AKick" Chan "List";end;when x1='AOA' then;do;call GetChan();"RAW "DalDest" :AOP" Chan "Add" Name;end;when x1='AOD' then;do;call GetChan();"RAW "DalDest" :AOP" Chan "Del" Name;end;when x1='AOL' then;do;call GetChan();"RAW "DalDest" :AOP" Chan "List";end;when x1='DOP' then;do;call GetChan();"RAW "DalDest" :OP" Chan "-"Name;end;when x1='SDE' then;do;call GetChan();"RAW "DalDest" :SET" Chan "DESC" Name;end;when x1='SML' then;do;call GetChan();"RAW "DalDest" :SET" Chan "MLOCK" Name;who=upper(Chan);end;when x1='SUR' then;do;call GetChan();"RAW "DalDest" :SET" Chan "URL" Name;who=upper(Chan);end;when x1='SKT' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "KEEPTOPIC" Name;end;when x1='SID' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "IDENT" Name;end;when x1='SME' then;do;call GetChan();select;when Name=1 then Name="AOP";when Name=2 then Name="SOP";when Name=3 then Name="FOUNDER";otherwise Name="NONE";end;"RAW "DalDest" :SET" Chan "MEMO" Name;end;when x1='SRE' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "RESTRICT" Name;end;when x1='SLO' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "LEAVEOPS" Name;end;when x1='SOG' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "OPGUARD" Name;end;when x1='STL' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="SOP";if Name=2 then Name="FOUNDER";"RAW "DalDest" :SET" Chan "TOPICLOCK" Name;end;when x1='SPR' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "PRIVATE" Name;end;when x1='SUS' then;do;call GetChan();if Name=0 then Name="OFF";if Name=1 then Name="ON";"RAW "DalDest" :SET" Chan "UNSECURE" Name;end;when x1='SOA' then;do;call GetChan();"RAW "DalDest" :SOP" Chan "Add" Name;end;when x1='SOD' then;do;call GetChan();"RAW "DalDest" :SOP" Chan "Del" Name;end;when x1='SOL' then;do;call GetChan();"RAW "DalDest" :SOP" Chan "List";end;otherwise;do;"echo P="d2c(27)"««MCF»" " "d2c(2)"ChanServ"d2c(2)" commands are:" CCmd1;"echo P="d2c(27)"««MCF»" ":"CCmd2;"echo P="d2c(27)"««MCF»" ":"CCmd3;end;end;when j1='M' then;do;select;when x2='DA' then "RAW "DalDest" :Del All";when x2='DE' then "RAW "DalDest" :Del" j3;when x2='LI' then "RAW "DalDest" :List";when x2='PU' then "RAW "DalDest" :Purge";when x2='RE' then "RAW "DalDest" :Read" j3;when x2='SE' then "RAW "DalDest" :Send" xhelp;when x2='UN' then "RAW "DalDest" :UnDel" j3;otherwise "echo P="d2c(27)"««MCF»" " "d2c(2)"MemoServ"d2c(2)" commands are:" MCmds;end;end;otherwise noop;end;select;when x2='MK' then;llit=":MASSKICK COMPLETE";when x2='UN' then;llit=upper(Chan)||" ARE NOW CLEARED";when x1='REG' then;llit=" ";when x1='SML' then;llit=" ";when x1='SUR' then;llit=" ";when x2='DR' then;llit=" ";when x2='PA' then;llit=" ";otherwise exit;end;qflag='N';do until qflag ~='N';getline;if line.command='440' then exit;xxp=pos('!',line.prefix);if xxp=0 then iterate;lrest=upper(line.rest);getmynick;UNick=upper(result);nl=length(UNick);SNick=upper(left(line.prefix,nl));if lrest=':%DAL'&SNick=UNick then exit;pfix=left(upper(line.prefix),8);if pfix ~= DalDest then iterate;if line.command ~='NOTICE' then iterate;if upper(line.dest) ~=UNick then iterate;if 0 ~=pos(llit,lrest) then qflag='J';end;select;when x1='REG' then;do;if 0=pos("REGISTERED",lrest) then exit;if j1='N' then;do;j4=j3;j3=MyNick;end;call open("Output",fname,'A');oline=strip(j3 j4);if oline ~="" then;wlen=writeln("Output",j3 j4);call close("Output");end;when x2='DR' then;do;if 0=pos("OPPED",lrest) then exit;address command "Echo >"fname DalVer;scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 while ocnt ~>mcnt;if 1=pos(upper(j3),upper(Dal.ocnt)) then iterate ocnt;oline=strip(Dal.ocnt);if oline ~="" then;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when x2='PA' then;do;if 0=pos("CHANGED",lrest) then exit;if j1='N' then;do;j4=j3;j3=MyNick;end;address command "Echo >"fname DalVer;scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 until ocnt=mcnt;if 1=pos(upper(j3),upper(Dal.ocnt)) then Dal.ocnt=j3 j4||TRest.ocnt;oline=strip(Dal.ocnt);if oline ~="" then;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when x1='SML' then;do;if 0=pos("MODE",lrest) then exit;address command "Echo >"fname DalVer;scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 until ocnt=mcnt;if 1=pos(who,upper(Dal.ocnt)) then;do;mpos=pos(' MODE ', Dal.ocnt);if mpos ~=0 then;do;m1=left(Dal.ocnt,mpos-1);m2= delword(substr(Dal.ocnt,mpos),1,2);Dal.ocnt=strip(m1) strip(m2);end;Dal.ocnt=strip(Dal.ocnt) 'MODE' strip(j3);end;oline=strip(Dal.ocnt);if oline ~="" then;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when x1='SUR' then;do;if 0=pos("LOCATION",lrest) then exit;address command "Echo >"fname DalVer;scnt=1;if 0 ~=pos('$VER', Dal.1) then scnt=2;call open("Output",fname,'A');do ocnt=scnt by 1 until ocnt=mcnt;if 1=pos(who,upper(Dal.ocnt)) then;do;mpos=pos(' URL ', Dal.ocnt);if mpos ~=0 then;do;m1=left(Dal.ocnt,mpos-1);m2= delword(substr(Dal.ocnt,mpos),1,2);Dal.ocnt=strip(m1) strip(m2);end;Dal.ocnt=strip(Dal.ocnt) 'URL' strip(j3);end;oline=strip(Dal.ocnt);if oline ~="" then;wlen=writeln("Output", Dal.ocnt);end ocnt;call close("Output");end;when qflag='J' then;do;address command wait 7 sec;"Say /JOIN" Chan;end;otherwise exit;end;exit;GetChan:;if 0 ~=pos('#',Chan) then Name=j4;if 0=pos('#',Chan) then;do;Chan=CurChan;Name=j3;end;return;IdAll:;if ncnt=0 then signal IdChans;qqq=1;UNick=upper(MyNick);if ncnt>1 then;do;do qcnt=1 by 1 until qcnt=ncnt;if UNick=upper(Nick.qcnt) then;do;qqq=qcnt;iterate qcnt;end;"RAW NICK "Nick.qcnt;"RAW NickServ :Identify "NPass.qcnt;call time(r);qflag='N';do until qflag ~='N';getline;lrest=upper(line.rest);if line.command='440' then exit;if line.command='433'&0 ~=pos(Nick.qcnt,line.rest) then;do;qflag='Y';iterate;end;xxp=pos('!',line.prefix);if xxp=0 then iterate;getmynick;MNick=upper(result);SNick=upper(left(line.prefix,xxp-1));if lrest=':%DAL'&SNick=MNick then exit;if SNick='NICKSERV'&0 ~=pos(MNick,lrest) then qflag='Y';end;xwait=time(e);xwp=pos('.',xwait)-1;xtime=29-left(xwait,xwp);if xtime>0 then address command wait xtime sec;end qcnt;"RAW NICK "MyNick;end;if UNick=upper(Nick.qqq) then "RAW NickServ :Identify "NPass.qqq;IdChans:;channels;JChans=upper(result);if ccnt>0 then;do;do xcntr=1 by 1 until xcntr=ccnt;"RAW ChanServ :Identify "Chan.xcntr CPass.xcntr;if 0=pos(upper(Chan.xcntr),JChans) then;do;"RAW JOIN "Chan.xcntr;qflag='N';do until qflag ~='N';getmynick;MNick=upper(result);getline;lrest=upper(line.rest);if line.command='440' then exit;xxp=pos('!',line.prefix);if xxp=0 then iterate;SNick=upper(left(line.prefix,xxp-1));if lrest=':%DAL'&SNick=MNick then exit;if SNick='CHANSERV'&upper(line.command)='MODE'&0 ~=pos(MNick,lrest) then qflag='Y';end;"RAW PART "Chan.xcntr;end;end xcntr;end;exit